package com.gamerole.prepare.controller;

import com.gamerole.prepare.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/learn")
public class LearnController {
    @Autowired
    StringRedisTemplate redisTemplate;

    @GetMapping(value = "/getQrUrl")
    public String getUrl() {
        String s = redisTemplate.opsForValue().get(Constant.QR_CODE_URL);
        if (s==null){
            return "微信二维码未生成";
        }else {
            return s;
        }
    }
}
